<?php
include ("../includes/config_conexao.php");

$id = $_POST["id"];
$data = $_POST["data"];
$arrData = explode("/",$data);
$hora = $_POST["hora"];

$r = mysql_query("select count(*) total
				from servico
				where id_usuario = {$id}
					and data_prev_servico = '".$arrData[2]."-".$arrData[1]."-".$arrData[0]."'
					and hr_prev_exec_servico = '{$hora}'");

$rr = mysql_fetch_array($r);

echo $rr['total'];
?>